package com.shou.service;

import com.shou.mapper.ActivityMapper;
import com.shou.pojo.Activity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ActivityServiceImpl implements ActivityService {

    @Autowired
    private ActivityMapper activityMapper;
    @Override
    public boolean addActivity(Activity activity) {
        return activityMapper.addActivity(activity);
    }

    @Override
    public boolean updateActivity(Activity activity) {
        return activityMapper.updateActivity(activity);
    }

    @Override
    public boolean deleteActivity(int activityId) {
        return activityMapper.deleteActivity(activityId);
    }

    @Override
    public List<Activity> getAllActivities() {
        return activityMapper.getAllActivities();
    }

    @Override
    public Activity findById(int id) {
        return null;
    }

    @Override
    public boolean enrollUser(int userId, int activityId) {
    return activityMapper.enrollActivity(userId, activityId);
    }

    // 其他业务逻辑方法...

}
